﻿/********************************************************************************
     File:																
            Manager.aspx.cs                         
     Description:
            来访年报表管理
     Author:									
            DDBuildTools
            http://DDBuildTools.supesoft.com
     Finish DateTime:
            2013/4/4 0:23:38
     History:
*********************************************************************************/
using System;
using System.Web.UI;
using System.Web.UI.WebControls;

using Model.Components;
using FrameWork;
using FrameWork.Components;
using FrameWork.WebControls;

namespace Model.Web.Module.Model.LFYear
{
    public partial class Manager : System.Web.UI.Page
    {
        Int32 IDX = (Int32)Common.sink("IDX", MethodType.Get, 10, 0, DataType.Int);
        string CMD = (string)Common.sink("CMD", MethodType.Get, 10, 1, DataType.Str);
        protected void Page_Load(object sender, EventArgs e)
        {
            FrameWorkPermission.CheckPagePermission(CMD);
            if (!Page.IsPostBack)
            {
                OnStart();
            }
        }
        private void BindYear()
        {
            int year = DateTime.Now.Year;
            tjYear_Input.Items.Add(new ListItem((year - 1).ToString(), (year - 1).ToString()));
            tjYear_Input.Items.Add(new ListItem(year.ToString(), year.ToString()));
            tjYear_Input.Items.Add(new ListItem((year + 1).ToString(), (year + 1).ToString()));
        }
        
        /// <summary>
        /// 开始操作
        /// </summary>
        private void OnStart()
        {
            LFYearEntity ut = BusinessFacadeModel.LFYearDisp(IDX);
            OnStartData(ut);
            BindYear();
            switch (CMD)
            { 
                case "New":
                    TabOptionItem1.Tab_Name = HeadMenuWebControls1.HeadOPTxt = "增加";
                    Hidden_Disp();
                    break;
                case "List":
                    TabOptionItem1.Tab_Name = HeadMenuWebControls1.HeadOPTxt = "查看";
                    Hidden_Input();
                    Button1.Visible = false;
                    AddEditButton();
                    break;
                case "Edit":
                    TabOptionItem1.Tab_Name = HeadMenuWebControls1.HeadOPTxt = "修改";
                    Hidden_Disp();
                    AddDeleteButton();
                    break;
                case "Delete":
                    ut.DataTable_Action_ = DataTable_Action.Delete;
                    if (BusinessFacadeModel.LFYearInsertUpdateDelete(ut) > 0)
                    {
                        EventMessage.MessageBox(1, "删除成功", string.Format("删除ID:{0}成功!", IDX), Icon_Type.OK, Common.GetHomeBaseUrl("Default.aspx"));
                    }
                    else {
                        EventMessage.MessageBox(1, "删除失败", string.Format("删除ID:{0}失败!", IDX), Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx"));
                    }
                    break;
                default :
                    EventMessage.MessageBox(2, "不存在操作字符串!", "不存在操作字符串!", Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx"));
                    break;
            }
        }

        /// <summary>
        /// 增加修改按钮
        /// </summary>
        private void AddEditButton()
        {
            HeadMenuButtonItem bi = new HeadMenuButtonItem();
            bi.ButtonPopedom = PopedomType.Edit;
            bi.ButtonName = "";
            bi.ButtonUrl = string.Format("?CMD=Edit&IDX={0}", IDX);
            HeadMenuWebControls1.ButtonList.Add(bi);
        }


        /// <summary>
        /// 增加删除按钮
        /// </summary>
        private void AddDeleteButton()
        {
            HeadMenuButtonItem bi = new HeadMenuButtonItem();
            bi.ButtonPopedom = PopedomType.Delete;
            bi.ButtonName = "";
            bi.ButtonUrlType = UrlType.JavaScript;
            bi.ButtonUrl = string.Format("DelData('?CMD=Delete&IDX={0}')", IDX);
            HeadMenuWebControls1.ButtonList.Add(bi);

            HeadMenuButtonItem bi1 = new HeadMenuButtonItem();
            bi1.ButtonPopedom = PopedomType.List;
            bi1.ButtonIcon = "back.gif";
            bi1.ButtonName = "返回";
            bi1.ButtonUrl = string.Format("?CMD=List&IDX={0}", IDX);
            HeadMenuWebControls1.ButtonList.Add(bi1);
        }

        /// <summary>
        /// 初始化数据
        /// </summary>
        /// <param name="ut"></param>
        private void OnStartData(LFYearEntity ut)
        {
        tjYear_Input.Text = tjYear_Disp.Text = ut.tjYear.ToString();
                a1_1_Input.Text = a1_1_Disp.Text = ut.a1_1.ToString();
                a1_2_Input.Text = a1_2_Disp.Text = ut.a1_2.ToString();
                a1_3_Input.Text = a1_3_Disp.Text = ut.a1_3.ToString();
                a2_1_Input.Text = a2_1_Disp.Text = ut.a2_1.ToString();
                a2_2_Input.Text = a2_2_Disp.Text = ut.a2_2.ToString();
                a2_3_Input.Text = a2_3_Disp.Text = ut.a2_3.ToString();
                a3_1_Input.Text = a3_1_Disp.Text = ut.a3_1.ToString();
                a3_2_Input.Text = a3_2_Disp.Text = ut.a3_2.ToString();
                a3_3_Input.Text = a3_3_Disp.Text = ut.a3_3.ToString();
                a4_1_Input.Text = a4_1_Disp.Text = ut.a4_1.ToString();
                a4_2_Input.Text = a4_2_Disp.Text = ut.a4_2.ToString();
                a4_3_Input.Text = a4_3_Disp.Text = ut.a4_3.ToString();
                a5_1_Input.Text = a5_1_Disp.Text = ut.a5_1.ToString();
                a5_2_Input.Text = a5_2_Disp.Text = ut.a5_2.ToString();
                a5_3_Input.Text = a5_3_Disp.Text = ut.a5_3.ToString();
                a6_1_Input.Text = a6_1_Disp.Text = ut.a6_1.ToString();
                a6_2_Input.Text = a6_2_Disp.Text = ut.a6_2.ToString();
                a6_3_Input.Text = a6_3_Disp.Text = ut.a6_3.ToString();
                a7_1_Input.Text = a7_1_Disp.Text = ut.a7_1.ToString();
                a7_2_Input.Text = a7_2_Disp.Text = ut.a7_2.ToString();
                a7_3_Input.Text = a7_3_Disp.Text = ut.a7_3.ToString();
                a8_1_Input.Text = a8_1_Disp.Text = ut.a8_1.ToString();
                a8_2_Input.Text = a8_2_Disp.Text = ut.a8_2.ToString();
                a8_3_Input.Text = a8_3_Disp.Text = ut.a8_3.ToString();
                a9_1_Input.Text = a9_1_Disp.Text = ut.a9_1.ToString();
                a9_2_Input.Text = a9_2_Disp.Text = ut.a9_2.ToString();
                a9_3_Input.Text = a9_3_Disp.Text = ut.a9_3.ToString();
                a10_1_Input.Text = a10_1_Disp.Text = ut.a10_1.ToString();
                a10_2_Input.Text = a10_2_Disp.Text = ut.a10_2.ToString();
                a10_3_Input.Text = a10_3_Disp.Text = ut.a10_3.ToString();
                a11_1_Input.Text = a11_1_Disp.Text = ut.a11_1.ToString();
                a11_2_Input.Text = a11_2_Disp.Text = ut.a11_2.ToString();
                a11_3_Input.Text = a11_3_Disp.Text = ut.a11_3.ToString();
                a12_1_Input.Text = a12_1_Disp.Text = ut.a12_1.ToString();
                a12_2_Input.Text = a12_2_Disp.Text = ut.a12_2.ToString();
                a12_3_Input.Text = a12_3_Disp.Text = ut.a12_3.ToString();
                a13_1_Input.Text = a13_1_Disp.Text = ut.a13_1.ToString();
                a13_2_Input.Text = a13_2_Disp.Text = ut.a13_2.ToString();
                a13_3_Input.Text = a13_3_Disp.Text = ut.a13_3.ToString();
                a14_1_Input.Text = a14_1_Disp.Text = ut.a14_1.ToString();
                a14_2_Input.Text = a14_2_Disp.Text = ut.a14_2.ToString();
                a14_3_Input.Text = a14_3_Disp.Text = ut.a14_3.ToString();
                a15_1_Input.Text = a15_1_Disp.Text = ut.a15_1.ToString();
                a15_2_Input.Text = a15_2_Disp.Text = ut.a15_2.ToString();
                a15_3_Input.Text = a15_3_Disp.Text = ut.a15_3.ToString();
                a16_1_Input.Text = a16_1_Disp.Text = ut.a16_1.ToString();
                a16_2_Input.Text = a16_2_Disp.Text = ut.a16_2.ToString();
                a16_3_Input.Text = a16_3_Disp.Text = ut.a16_3.ToString();
                a17_1_Input.Text = a17_1_Disp.Text = ut.a17_1.ToString();
                a17_2_Input.Text = a17_2_Disp.Text = ut.a17_2.ToString();
                a17_3_Input.Text = a17_3_Disp.Text = ut.a17_3.ToString();
                a18_1_Input.Text = a18_1_Disp.Text = ut.a18_1.ToString();
                a18_2_Input.Text = a18_2_Disp.Text = ut.a18_2.ToString();
                a183_Input.Text = a183_Disp.Text = ut.a183.ToString();
                a19_1_Input.Text = a19_1_Disp.Text = ut.a19_1.ToString();
                a19_2_Input.Text = a19_2_Disp.Text = ut.a19_2.ToString();
                a19_3_Input.Text = a19_3_Disp.Text = ut.a19_3.ToString();
                a20_1_Input.Text = a20_1_Disp.Text = ut.a20_1.ToString();
                a20_2_Input.Text = a20_2_Disp.Text = ut.a20_2.ToString();
                a20_3_Input.Text = a20_3_Disp.Text = ut.a20_3.ToString();
                a21_1_Input.Text = a21_1_Disp.Text = ut.a21_1.ToString();
                a21_2_Input.Text = a21_2_Disp.Text = ut.a21_2.ToString();
                a21_3_Input.Text = a21_3_Disp.Text = ut.a21_3.ToString();
                a22_1_Input.Text = a22_1_Disp.Text = ut.a22_1.ToString();
                a22_2_Input.Text = a22_2_Disp.Text = ut.a22_2.ToString();
                a22_3_Input.Text = a22_3_Disp.Text = ut.a22_3.ToString();
                dep_Input.Text = dep_Disp.Text = ut.dep.ToString();
                tj_Input.Text = tj_Disp.Text = ut.tj.ToString();
                phone_Input.Text = phone_Disp.Text = ut.phone.ToString();
                
        }

        /// <summary>
        /// 隐藏输入框
        /// </summary>
        private void Hidden_Input()
        {
        tjYear_Input.Visible = false;
        a1_1_Input.Visible = false;
        a1_2_Input.Visible = false;
        a1_3_Input.Visible = false;
        a2_1_Input.Visible = false;
        a2_2_Input.Visible = false;
        a2_3_Input.Visible = false;
        a3_1_Input.Visible = false;
        a3_2_Input.Visible = false;
        a3_3_Input.Visible = false;
        a4_1_Input.Visible = false;
        a4_2_Input.Visible = false;
        a4_3_Input.Visible = false;
        a5_1_Input.Visible = false;
        a5_2_Input.Visible = false;
        a5_3_Input.Visible = false;
        a6_1_Input.Visible = false;
        a6_2_Input.Visible = false;
        a6_3_Input.Visible = false;
        a7_1_Input.Visible = false;
        a7_2_Input.Visible = false;
        a7_3_Input.Visible = false;
        a8_1_Input.Visible = false;
        a8_2_Input.Visible = false;
        a8_3_Input.Visible = false;
        a9_1_Input.Visible = false;
        a9_2_Input.Visible = false;
        a9_3_Input.Visible = false;
        a10_1_Input.Visible = false;
        a10_2_Input.Visible = false;
        a10_3_Input.Visible = false;
        a11_1_Input.Visible = false;
        a11_2_Input.Visible = false;
        a11_3_Input.Visible = false;
        a12_1_Input.Visible = false;
        a12_2_Input.Visible = false;
        a12_3_Input.Visible = false;
        a13_1_Input.Visible = false;
        a13_2_Input.Visible = false;
        a13_3_Input.Visible = false;
        a14_1_Input.Visible = false;
        a14_2_Input.Visible = false;
        a14_3_Input.Visible = false;
        a15_1_Input.Visible = false;
        a15_2_Input.Visible = false;
        a15_3_Input.Visible = false;
        a16_1_Input.Visible = false;
        a16_2_Input.Visible = false;
        a16_3_Input.Visible = false;
        a17_1_Input.Visible = false;
        a17_2_Input.Visible = false;
        a17_3_Input.Visible = false;
        a18_1_Input.Visible = false;
        a18_2_Input.Visible = false;
        a183_Input.Visible = false;
        a19_1_Input.Visible = false;
        a19_2_Input.Visible = false;
        a19_3_Input.Visible = false;
        a20_1_Input.Visible = false;
        a20_2_Input.Visible = false;
        a20_3_Input.Visible = false;
        a21_1_Input.Visible = false;
        a21_2_Input.Visible = false;
        a21_3_Input.Visible = false;
        a22_1_Input.Visible = false;
        a22_2_Input.Visible = false;
        a22_3_Input.Visible = false;
        dep_Input.Visible = false;
        tj_Input.Visible = false;
        phone_Input.Visible = false;
        
        }

        /// <summary>
        /// 隐藏显示框
        /// </summary>
        private void Hidden_Disp()
        {
        tjYear_Disp.Visible = false;
        a1_1_Disp.Visible = false;
        a1_2_Disp.Visible = false;
        a1_3_Disp.Visible = false;
        a2_1_Disp.Visible = false;
        a2_2_Disp.Visible = false;
        a2_3_Disp.Visible = false;
        a3_1_Disp.Visible = false;
        a3_2_Disp.Visible = false;
        a3_3_Disp.Visible = false;
        a4_1_Disp.Visible = false;
        a4_2_Disp.Visible = false;
        a4_3_Disp.Visible = false;
        a5_1_Disp.Visible = false;
        a5_2_Disp.Visible = false;
        a5_3_Disp.Visible = false;
        a6_1_Disp.Visible = false;
        a6_2_Disp.Visible = false;
        a6_3_Disp.Visible = false;
        a7_1_Disp.Visible = false;
        a7_2_Disp.Visible = false;
        a7_3_Disp.Visible = false;
        a8_1_Disp.Visible = false;
        a8_2_Disp.Visible = false;
        a8_3_Disp.Visible = false;
        a9_1_Disp.Visible = false;
        a9_2_Disp.Visible = false;
        a9_3_Disp.Visible = false;
        a10_1_Disp.Visible = false;
        a10_2_Disp.Visible = false;
        a10_3_Disp.Visible = false;
        a11_1_Disp.Visible = false;
        a11_2_Disp.Visible = false;
        a11_3_Disp.Visible = false;
        a12_1_Disp.Visible = false;
        a12_2_Disp.Visible = false;
        a12_3_Disp.Visible = false;
        a13_1_Disp.Visible = false;
        a13_2_Disp.Visible = false;
        a13_3_Disp.Visible = false;
        a14_1_Disp.Visible = false;
        a14_2_Disp.Visible = false;
        a14_3_Disp.Visible = false;
        a15_1_Disp.Visible = false;
        a15_2_Disp.Visible = false;
        a15_3_Disp.Visible = false;
        a16_1_Disp.Visible = false;
        a16_2_Disp.Visible = false;
        a16_3_Disp.Visible = false;
        a17_1_Disp.Visible = false;
        a17_2_Disp.Visible = false;
        a17_3_Disp.Visible = false;
        a18_1_Disp.Visible = false;
        a18_2_Disp.Visible = false;
        a183_Disp.Visible = false;
        a19_1_Disp.Visible = false;
        a19_2_Disp.Visible = false;
        a19_3_Disp.Visible = false;
        a20_1_Disp.Visible = false;
        a20_2_Disp.Visible = false;
        a20_3_Disp.Visible = false;
        a21_1_Disp.Visible = false;
        a21_2_Disp.Visible = false;
        a21_3_Disp.Visible = false;
        a22_1_Disp.Visible = false;
        a22_2_Disp.Visible = false;
        a22_3_Disp.Visible = false;
        dep_Disp.Visible = false;
        tj_Disp.Visible = false;
        phone_Disp.Visible = false;
       
        }

        /// <summary>
        /// 增加/修改事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
        
            int tjYear_Value = (int)Common.sink(tjYear_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a1_1_Value = (int)Common.sink(a1_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a1_2_Value = (int)Common.sink(a1_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a1_3_Value = (double)Common.sink(a1_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a2_1_Value = (int)Common.sink(a2_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a2_2_Value = (int)Common.sink(a2_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a2_3_Value = (double)Common.sink(a2_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a3_1_Value = (int)Common.sink(a3_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a3_2_Value = (int)Common.sink(a3_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a3_3_Value = (double)Common.sink(a3_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a4_1_Value = (int)Common.sink(a4_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a4_2_Value = (int)Common.sink(a4_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a4_3_Value = (double)Common.sink(a4_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a5_1_Value = (int)Common.sink(a5_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a5_2_Value = (int)Common.sink(a5_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a5_3_Value = (double)Common.sink(a5_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a6_1_Value = (int)Common.sink(a6_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a6_2_Value = (int)Common.sink(a6_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a6_3_Value = (double)Common.sink(a6_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a7_1_Value = (int)Common.sink(a7_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a7_2_Value = (int)Common.sink(a7_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a7_3_Value = (double)Common.sink(a7_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a8_1_Value = (int)Common.sink(a8_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a8_2_Value = (int)Common.sink(a8_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a8_3_Value = (double)Common.sink(a8_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a9_1_Value = (int)Common.sink(a9_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a9_2_Value = (int)Common.sink(a9_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a9_3_Value = (double)Common.sink(a9_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a10_1_Value = (int)Common.sink(a10_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a10_2_Value = (int)Common.sink(a10_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a10_3_Value = (double)Common.sink(a10_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a11_1_Value = (int)Common.sink(a11_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a11_2_Value = (int)Common.sink(a11_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a11_3_Value = (double)Common.sink(a11_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a12_1_Value = (int)Common.sink(a12_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a12_2_Value = (int)Common.sink(a12_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a12_3_Value = (double)Common.sink(a12_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a13_1_Value = (int)Common.sink(a13_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a13_2_Value = (int)Common.sink(a13_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a13_3_Value = (double)Common.sink(a13_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a14_1_Value = (int)Common.sink(a14_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a14_2_Value = (int)Common.sink(a14_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a14_3_Value = (double)Common.sink(a14_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a15_1_Value = (int)Common.sink(a15_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a15_2_Value = (int)Common.sink(a15_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a15_3_Value = (double)Common.sink(a15_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a16_1_Value = (int)Common.sink(a16_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a16_2_Value = (int)Common.sink(a16_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a16_3_Value = (double)Common.sink(a16_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a17_1_Value = (int)Common.sink(a17_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a17_2_Value = (int)Common.sink(a17_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a17_3_Value = (double)Common.sink(a17_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a18_1_Value = (int)Common.sink(a18_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a18_2_Value = (int)Common.sink(a18_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a183_Value = (double)Common.sink(a183_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a19_1_Value = (int)Common.sink(a19_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a19_2_Value = (int)Common.sink(a19_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a19_3_Value = (double)Common.sink(a19_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a20_1_Value = (int)Common.sink(a20_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a20_2_Value = (int)Common.sink(a20_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a20_3_Value = (double)Common.sink(a20_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a21_1_Value = (int)Common.sink(a21_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a21_2_Value = (int)Common.sink(a21_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a21_3_Value = (double)Common.sink(a21_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            int a22_1_Value = (int)Common.sink(a22_1_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            int a22_2_Value = (int)Common.sink(a22_2_Input.UniqueID, MethodType.Post, 10, 0, DataType.Int);
            double a22_3_Value = (double)Common.sink(a22_3_Input.UniqueID, MethodType.Post, 53, 0, DataType.Double);
            string dep_Value = (string)Common.sink(dep_Input.UniqueID, MethodType.Post, 200, 0, DataType.Str);
            string tj_Value = (string)Common.sink(tj_Input.UniqueID, MethodType.Post, 200, 0, DataType.Str);
            string phone_Value = (string)Common.sink(phone_Input.UniqueID, MethodType.Post, 200, 0, DataType.Str);
            int tjGroup_Value = UserData.GetUserDate.U_GroupID;

            DateTime? AddDate_Value = DateTime.Now;
                
            LFYearEntity ut = BusinessFacadeModel.LFYearDisp(IDX);
            
            ut.tjYear = tjYear_Value;
            ut.a1_1 = a1_1_Value;
            ut.a1_2 = a1_2_Value;
            ut.a1_3 = a1_3_Value;
            ut.a2_1 = a2_1_Value;
            ut.a2_2 = a2_2_Value;
            ut.a2_3 = a2_3_Value;
            ut.a3_1 = a3_1_Value;
            ut.a3_2 = a3_2_Value;
            ut.a3_3 = a3_3_Value;
            ut.a4_1 = a4_1_Value;
            ut.a4_2 = a4_2_Value;
            ut.a4_3 = a4_3_Value;
            ut.a5_1 = a5_1_Value;
            ut.a5_2 = a5_2_Value;
            ut.a5_3 = a5_3_Value;
            ut.a6_1 = a6_1_Value;
            ut.a6_2 = a6_2_Value;
            ut.a6_3 = a6_3_Value;
            ut.a7_1 = a7_1_Value;
            ut.a7_2 = a7_2_Value;
            ut.a7_3 = a7_3_Value;
            ut.a8_1 = a8_1_Value;
            ut.a8_2 = a8_2_Value;
            ut.a8_3 = a8_3_Value;
            ut.a9_1 = a9_1_Value;
            ut.a9_2 = a9_2_Value;
            ut.a9_3 = a9_3_Value;
            ut.a10_1 = a10_1_Value;
            ut.a10_2 = a10_2_Value;
            ut.a10_3 = a10_3_Value;
            ut.a11_1 = a11_1_Value;
            ut.a11_2 = a11_2_Value;
            ut.a11_3 = a11_3_Value;
            ut.a12_1 = a12_1_Value;
            ut.a12_2 = a12_2_Value;
            ut.a12_3 = a12_3_Value;
            ut.a13_1 = a13_1_Value;
            ut.a13_2 = a13_2_Value;
            ut.a13_3 = a13_3_Value;
            ut.a14_1 = a14_1_Value;
            ut.a14_2 = a14_2_Value;
            ut.a14_3 = a14_3_Value;
            ut.a15_1 = a15_1_Value;
            ut.a15_2 = a15_2_Value;
            ut.a15_3 = a15_3_Value;
            ut.a16_1 = a16_1_Value;
            ut.a16_2 = a16_2_Value;
            ut.a16_3 = a16_3_Value;
            ut.a17_1 = a17_1_Value;
            ut.a17_2 = a17_2_Value;
            ut.a17_3 = a17_3_Value;
            ut.a18_1 = a18_1_Value;
            ut.a18_2 = a18_2_Value;
            ut.a183 = a183_Value;
            ut.a19_1 = a19_1_Value;
            ut.a19_2 = a19_2_Value;
            ut.a19_3 = a19_3_Value;
            ut.a20_1 = a20_1_Value;
            ut.a20_2 = a20_2_Value;
            ut.a20_3 = a20_3_Value;
            ut.a21_1 = a21_1_Value;
            ut.a21_2 = a21_2_Value;
            ut.a21_3 = a21_3_Value;
            ut.a22_1 = a22_1_Value;
            ut.a22_2 = a22_2_Value;
            ut.a22_3 = a22_3_Value;
            ut.dep = dep_Value;
            ut.tj = tj_Value;
            ut.phone = phone_Value;
            ut.tjGroup = tjGroup_Value;
            ut.AddDate = AddDate_Value;
            
            if (CMD == "New")
            {
                ut.DataTable_Action_ = DataTable_Action.Insert;
            }
            else if (CMD == "Edit")
            {
                ut.DataTable_Action_ = DataTable_Action.Update;
            }
            else
            {
                EventMessage.MessageBox(2, "不存在操作字符串!", "不存在操作字符串!", Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx"));
            }
            Int32 rInt = BusinessFacadeModel.LFYearInsertUpdateDelete(ut);
            if ( rInt> 0)
            {
                string OpTxt = string.Format("增加来访报表成功!(ID:{0})", rInt);
                if (ut.DataTable_Action_ == DataTable_Action.Update)
                    OpTxt = string.Format("修改来访报表成功!(ID:{0})",IDX);
                EventMessage.MessageBox(1, "操作成功", OpTxt, Icon_Type.OK, Common.GetHomeBaseUrl("Default.aspx"));
            }
            else if (rInt == -2)
            {
                EventMessage.MessageBox(1, "操作失败", "操作失败,存在相同的键值(用户名/数据)!", Icon_Type.Alert, Common.GetHomeBaseUrl("Default.aspx"));
            }
            else
            {
                EventMessage.MessageBox(1, "操作失败", string.Format("操作失败,返回值:{0}!", rInt), Icon_Type.Error, Common.GetHomeBaseUrl("Default.aspx"));
            }
        }
    }
}
